0<template>
  <div>setup函数的顶层是async</div>
</template>
<script setup>
function sayHi() {
  return new Promise((resolve, reject) => {
    let flag = true;
    if (flag) {
      setTimeout(() => {
        alert("nihao");
        resolve("success");
      }, 3000);
    } else {
      reject("fail");
    }
  });
}
let res = await sayHi();
console.log(res);
</script>
